package com.kuaiditu.assistant.util;

import android.graphics.Color;
import android.widget.TextView;

import com.kuaiditu.assistant.R;
import com.kuaiditu.assistant.entity.ExpressCom;

/**
 * Created by Eenie on 2017/8/31.
 * Email: eeniework@gmail.com
 * Des:
 */

public class JudgeExpressUtil {


    public static void analyze(ExpressCom netsiteBean, TextView tv) {
        String name = netsiteBean.getNetsite_expressCompanyName().substring(0, 1);
        tv.setText(name);
        switch (netsiteBean.getNetsite_expressCompanyId()) {
            case ExpressCom.EXPRESS_COM_CODE_YD:
                tv.setText("韵");
                tv.setTextColor(Color.WHITE);
                tv.setBackgroundResource(R.drawable.shape_slide_circle_yellow);
                break;
            case ExpressCom.EXPRESS_COM_CODE_ZT:
                tv.setText("中");
                tv.setTextColor(Color.WHITE);
                tv.setBackgroundResource(R.drawable.shape_slide_circle_blue_zt);
                break;
            case ExpressCom.EXPRESS_COM_CODE_YT:
                tv.setText("圆");
                tv.setTextColor(Color.WHITE);
                tv.setBackgroundResource(R.drawable.shape_slide_circle_blue_zt);
                break;
            case ExpressCom.EXPRESS_COM_CODE_ST:
                tv.setText("申");
                tv.setTextColor(Color.WHITE);
                tv.setBackgroundResource(R.drawable.shape_slide_circle_blue_zt);
                break;
            case ExpressCom.EXPRESS_COM_CODE_SF:
                tv.setText("顺");
                tv.setTextColor(Color.WHITE);
                tv.setBackgroundResource(R.drawable.shape_slide_circle_blue_zt);
                break;

            default:
                tv.setText("未");
                tv.setTextColor(Color.WHITE);
                tv.setBackgroundColor(Color.BLUE);
                break;
        }

    }
    public static void analyze(int com_id, TextView tv) {
        switch (com_id) {
            case ExpressCom.EXPRESS_COM_CODE_YD:
                tv.setText("韵");
                tv.setTextColor(Color.WHITE);
                tv.setBackgroundResource(R.drawable.shape_slide_circle_yellow);
                break;
            case ExpressCom.EXPRESS_COM_CODE_ZT:
                tv.setText("中");
                tv.setTextColor(Color.WHITE);
                tv.setBackgroundResource(R.drawable.shape_slide_circle_blue_zt);
                break;
            case ExpressCom.EXPRESS_COM_CODE_YT:
                tv.setText("圆");
                tv.setTextColor(Color.WHITE);
                tv.setBackgroundResource(R.drawable.shape_slide_circle_blue_zt);
                break;
            case ExpressCom.EXPRESS_COM_CODE_ST:
                tv.setText("申");
                tv.setTextColor(Color.WHITE);
                tv.setBackgroundResource(R.drawable.shape_slide_circle_blue_zt);
                break;
            case ExpressCom.EXPRESS_COM_CODE_SF:
                tv.setText("顺");
                tv.setTextColor(Color.WHITE);
                tv.setBackgroundResource(R.drawable.shape_slide_circle_blue_zt);
                break;

            default:
                tv.setText("未");
                tv.setTextColor(Color.WHITE);
                tv.setBackgroundColor(Color.BLUE);
                break;
        }


    }


}
